package agent;

import instanceXMLParser.Instance;
import aima.core.agent.Action;
import aima.core.agent.AgentProgram;
import aima.core.agent.Percept;
import aima.core.agent.impl.AbstractAgent;

public class DavideSpataroAgent extends AbstractAgent implements AgentProgram{

	Vacuum_Agent_Solver solver;
	Instance i;
	int mossa=0;
	public DavideSpataroAgent(Instance i) {
		solver= new Vacuum_Agent_Solver();
		this.i=i;
	}
	@Override
	public Action execute(Percept p) {
		if(mossa==0){
//			System.out.println("Sto risolvendo...");
			solver.solveFromInstance(i);
		}
		mossa++;
		return solver.solution.get(mossa-1);
	}
}
